<!DOCTYPE html>
<html>
<head>
    <meta charset="utf-8">
    <title></title>
    <meta name="renderer" content="webkit">
    <meta http-equiv="X-UA-Compatible" content="IE=edge,chrome=1">
    <meta name="viewport" content="width=device-width, initial-scale=1, maximum-scale=1">

    <link rel="stylesheet" href="/Modules/system/layuimini/lib/layui-v2.5.5/css/layui.css" media="all">
    <link rel="stylesheet" href="/Modules/system/layuimini/css/public.css" media="all">

</head>
<body>

<style>

    .layuimini-container {
        width: 100%;
        float: left;
        padding-top: 20px;
    }

    .layui-form-item {
        float: left;
        clear: none !important;
    }

    .collectionNotes {
        width: 100% !important;
        float: left;
    }

    .layui-input-inline {
        margin-right: 0px !important;
    }

    .gui .layui-input-inline {
        width: 120px !important;
    }

    .gui input {
        background: #ffffff !important;
    }

    .li {
        padding: 8px 0 !important;
    }
</style>


<div class="layuimini-container">

    <form class="layui-form layui-form-pane" action="javascript:;">






        <div class="layui-row layui-col-space1" style="padding-left: 40px">
            <div class="layui-col-md3" >
                <div class="layui-inline">
                    <label class="layui-form-label" style="padding: 8px 0">文件主题</label>
                    <div class="layui-input-inline">
                        <input type="text" id="DeclarationNo" name="DeclarationNo"  style="background:#eee" readonly="true"  value="{{$name}}" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md3" >
                <div class="layui-inline">
                    <label class="layui-form-label" style="padding: 8px 0">文件类型</label>
                    <div class="layui-input-inline">
                        <input type="text" id="DeclarationNo" name="DeclarationNo"  style="background:#eee" readonly="true"  value="{{$type}}" class="layui-input">
                    </div>
                </div>
            </div>
            <div class="layui-col-md3" >
                <div class="layui-inline">
                    <label class="layui-form-label" style="padding: 8px 0">发文部门</label>
                    <div class="layui-input-inline">
                        <input type="text" id="DeclarationNo" name="DeclarationNo"  style="background:#eee" readonly="true"  value="{{$department}}" class="layui-input">
                    </div>
                </div>
            </div>
        </div>



        <div class="layui-form-item layui-form-text"
             style="margin-top: 20px; padding-left: 40px; width: 60% !important;">
            <label class="layui-form-label">文件内容</label>
            <div class="layui-input-block">
                <textarea name="accountingNotes1"  class="layui-textarea accountingNotes1">{{$con}}</textarea>

            </div>
        </div>

        <div class="layui-form-item layui-form-text"
             style="margin-top: 20px; padding-left: 40px; width: 60% !important;">
            <label class="layui-form-label">审批意见</label>
            <div class="layui-input-block">
                <textarea name="accountingNotes1" placeholder="请输入内容" class="layui-textarea accountingNotes1"></textarea>
            </div>
        </div>

        @if (isset($hide))


        @else
            <div class="layui-form-item layui-form-text"
                 style="margin-top: 20px; padding-left: 40px; width: 60% !important;">
                <button class="layui-btn confirmCollection">审核通过</button>
                <button type="reset" class="layui-btn layui-btn-danger caseReturn">拒绝退回</button>
                <button type="reset" class="layui-btn layui-btn-primary cancel">取消</button>

            </div>
        @endif












    </form>

</div>
<script src="/Modules/system/layuimini/lib/layui-v2.5.5/layui.js" charset="utf-8"></script>

<!-- 注意：如果你直接复制所有代码到本地，上述js路径需要改成你本地的 -->
<script>

    layui.use(['form', 'layedit', 'laydate'], function () {

        var $ = layui.jquery;
        var layer = layui.layer;
        var form = layui.form;
        layui.cancelStatus = 1;
        state=''


        //单笔确认:todo:接着开发。
        $(".confirmCollection").click(function () {

            var accountingNotes = $(".accountingNotes").val();


            {{--if(JSON.parse({{$status}})==1){--}}
            {{--    state=2--}}
            {{--}else if(JSON.parse({{$status}})==2){--}}
            {{--    state=3--}}

            {{--}--}}
            layer.confirm('确认核算结果通过吗?', {
                btn: ['确定', 'Cancel'] //按钮
            }, function () {
                //万能接口
                $.ajax({
                    type: "POST",
                    url: "/chinadmin/admin/common/update",
                    timeout: 100000, //超时时间设置，单位毫秒 为一秒
                    data: {
                        "model": "Modules\\Chinadmin\\Models\\FileDataModel",
                        "id_field": "id",
                        "id_val": JSON.parse({{$id}}),
                        "up_arr": {
                            "status": 1,
                        },
                    },
                    dataType: "json",      //如果有此选项成功返回的json会自动变成对象，如果没有需要用JSON.parse()转换
                    success: function (data) {
                        layer.msg(data.msg);
                        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        parent.layer.close(index);
                        //关闭父级页面的表格//currentTableId为表格id
                        parent.layui.table.reload('currentTableId');

                    }
                });

            }, function () {

            });

        });







        $(".cancel").click(function () {
            var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
            parent.layer.close(index);
        });

        $(".caseReturn").click(function () {
            var accountingNotes = $(".accountingNotes1").val();
            layer.confirm('您确认退回,案件信息需要退回？', {
                btn: ['确定', 'cancel'] //按钮
            }, function () {

                //万能接口
                $.ajax({
                    type: "POST",
                    url: "/chinadmin/admin/common/update",
                    timeout: 100000, //超时时间设置，单位毫秒 为一秒
                    data: {
                        "model": "Modules\\Chinadmin\\Models\\FileDataModel",
                        "id_field": "id",
                        "id_val": JSON.parse({{$id}}),
                        "up_arr": {
                            "status": 2,
                            'fallback':accountingNotes

                        },
                    },
                    dataType: "json",      //如果有此选项成功返回的json会自动变成对象，如果没有需要用JSON.parse()转换
                    success: function (data) {

                        layer.msg(data.msg);

                        var index = parent.layer.getFrameIndex(window.name); //获取窗口索引
                        parent.layer.close(index);
                        //关闭父级页面的表格//currentTableId为表格id
                        parent.layui.table.reload('currentTableId');

                    }
                });

            }, function () {

            });


        });


    });

</script>

</body>
</html>





